import request from "@/utils/request";

// 查询用户信息列表
export function listUser(query) {
  return request({
    url: "/ds/user/list",
    method: "get",
    params: query,
  });
}

// 查询用户信息详细
export function getUser(uid) {
  return request({
    url: "/ds/user/" + uid,
    method: "get",
  });
}

// 新增用户信息
export function addUser(data) {
  return request({
    url: "/ds/user",
    method: "post",
    data: data,
  });
}

export function userReward(data) {
  return request({
    url: "/ds/reward/list",
    params: data,
    method: "get",
  });
}

// 修改用户信息
export function updateUser(data) {
  return request({
    url: "/ds/user",
    method: "put",
    data: data,
  });
}

// 删除用户信息
export function delUser(uid) {
  return request({
    url: "/ds/user/" + uid,
    method: "delete",
  });
}

// 快速登录
export function fastLogin(uid) {
  return request({
    url: "/ds/user/login?uid=" + uid,
    method: "get",
  });
}

// 导出用户信息
export function exportUser(query) {
  return request({
    url: "/ds/user/export",
    method: "get",
    params: query,
  });
}
/**
 * 查询用户团队
 * @param {*} query
 * @returns
 */
export const userTeam = (query, headers) => {
  return request({
    headers,
    url: "/ds/user/userTeam",
    method: "get",
    params: query,
  });
};

/**
 * 用户YKGFC交易记录
 * @param {*} query
 * @returns
 */
export const userTransformation = (query) => {
  return request({
    url: "/ds/transformation/list",
    method: "get",
    params: query,
  });
};

export const exportUserTransformation = (query) => {
  return request({
    url: "/ds/transformation/export",
    method: "get",
    params: query,
  });
};
/**
 * 查询
 * @param {*} query
 * @returns
 */
export const queryYkgfc = (query) => {
  return request({
    url: "/ds/transformation/queryYkgfc",
    method: "get",
    params: query,
  });
};

export const refundYKGFC = (query) => {
  return request({
    url: "/ds/transformation/editFail",
    method: "get",
    params: query,
  });
};
/**
 * 用户团队
 * @param {*} query
 * @returns
 */
export const userTeamInfo = (query) => {
  return request({
    url: "/ds/user/userTeam",
    method: "get",
    params: query,
  });
};

/**
 * 质押用户YKGFC
 * @param {*} query
 * @returns
 */
export const pledgeStore = (query) => {
  return request({
    url: "/ds/user/pledgeStore",
    method: "get",
    params: query,
  });
};

/**
 * 查询油卡
 * @param {*} query
 * @returns
 */
export const queryFullCard = (query) => {
  return request({
    url: "/ds/copy/list",
    method: "get",
    params: query,
  });
};
/**
 * 解锁油卡
 * @param {*} query
 * @returns
 */
export const deblockingFullCard = (query) => {
  return request({
    url: "/ds/copy/unlockUser",
    method: "get",
    params: query,
  });
};

export const userRecharge = (query) => {
  return request({
    url: "/ds/user/recharge",
    method: "get",
    params: query,
  });
};
